#-*- coding: utf-8 -*-
#!/usr/bin/env python

#-*- coding: utf-8 -*-
#!/usr/bin/env python

'''
author: Bruno Alves, n.º 6152
'''

'''
Class Node - To create a node from a tree
''' 
class Node:
    '''
    Node constructor 
    '''
    def __init__(self, key, value):
        self.key = key
        self.value = value
        self.parent = None
        self.left   = None
        self.right  = None
        self.LC = 0
        self.RC = 0
        pass
    
    '''
    Method to show data in string from 
    '''
    def __str__(self):
        s = str(self.key) + ' ; ' + str(self.value)
        s += '('      
        if self.parent == None:
            s += 'None'  + ', ' 
        else:
            s += str(self.parent.key) + ', ' 

        if self.left == None:
            s += 'None'  + ', ' 
        else:
            s += str(self.left.key) + ', ' 

        if self.right == None:
            s += 'None' + ')' 
        else:
            s += str(self.right.key) + ')' 
        return s
    
